package com.gome.ocean.common.utils;

/**
 * 换算
 * 
 * @author haqiaolong 2016年4月5日 下午5:34:25
 * @since 5.0.0
 */
public class MathUtil {

    public static double getDerivate(long newVal, long oldVal, long timestamp, long oldtimestamp, double scale) {
        return timestamp - oldtimestamp == 0 ? 0 : (newVal - oldVal) * scale / (timestamp - oldtimestamp);
    }

}
